import { defineStore } from 'pinia';
import { v4 as uuidv4 } from 'uuid';
import { ref } from 'vue';

export const useChatStatusStore = defineStore('chat-status', () => {
  const startChat = ref(false);
  const currentChatId = ref('');
  const educationMode = ref(false);
  const personalizedPath = ref(true);
  const explainLevel = ref(2);
  const collectMetrics = ref(true);
  const subject = ref('数学');
  const practiceMode = ref<'qa' | 'trainer'>('qa');
  const difficulty = ref(2);
  const studyGoal = ref('掌握本章核心知识点并建立练习路径');
  const topics = ref<string[]>(['二次函数']);

  const newChatId = () => {
    currentChatId.value = uuidv4();
  };

  return { startChat, currentChatId, newChatId, educationMode, personalizedPath, explainLevel, collectMetrics, subject, practiceMode, difficulty, studyGoal, topics };
});
